using System;
using System.Collections.Generic;
using KKCai.TV.Model;

namespace KKCai.TV.DAL
{
    public class RecordDao : Core.AbstractDao<RecordInfo>
    {
        private const string hql = "from RecordInfo r where r.id > ?";

        public IList<RecordInfo> List(int limit)
        {
            RecordInfo r = this.Order("id", false, 1)[0];

            int start = r.ID - limit;

            return Session.CreateQuery(hql).SetInt32(0, start).List<RecordInfo>();
        }
    }
}
